package com.example.libraryManager.controller;


import com.example.libraryManager.entity.Kinds;
import com.example.libraryManager.service.impl.KindsService;
import com.example.libraryManager.utils.ResultUtils;
import com.example.libraryManager.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author admin
 * @since 2022-09-02
 */
@RestController
@RequestMapping("/kinds")
public class KindsController {

    @Autowired
    KindsService kindsService;

    /**
     * 获取图书的类型
     * @return
     */
    @GetMapping("/getKinds")
    public ResultVo getKinds(){
        List<Kinds> kinds=kindsService.getAll();

        return ResultUtils.success(kinds);
    }

}

